<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>C++ Web Framework: /home/herik/CPPWebFramework/CPPWebFramework/cwf/qlistobject.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="logo.png"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">C++ Web Framework
   &#160;<span id="projectnumber">3.0</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_b2448bd9c6b97c57da490a507d179d6c.html">CPPWebFramework</a></li><li class="navelem"><a class="el" href="dir_3bacee99d34edff13677baafd8c3a47f.html">cwf</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle">
<div class="title">qlistobject.h</div>  </div>
</div><!--header-->
<div class="contents">
<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="comment">/*</span></div><div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="comment"> Copyright 2017 Herik Lima de Castro and Marcelo Medeiros Eler</span></div><div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="comment"> Distributed under MIT license, or public domain if desired and</span></div><div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="comment"> recognized in your jurisdiction.</span></div><div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="comment"> See file LICENSE for detail.</span></div><div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="comment">*/</span></div><div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;</div><div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="preprocessor">#ifndef QLISTOBJECT_H</span></div><div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;<span class="preprocessor">#define QLISTOBJECT_H</span></div><div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;</div><div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;<span class="preprocessor">#include &lt;QObject&gt;</span></div><div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;<span class="preprocessor">#include &quot;cppwebframework_global.h&quot;</span></div><div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;</div><div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;CWF_BEGIN_NAMESPACE</div><div class="line"><a name="l00020"></a><span class="lineno"><a class="line" href="class_q_list_object.html">   20</a></span>&#160;<span class="keyword">class </span>CPPWEBFRAMEWORKSHARED_EXPORT <a class="code" href="class_q_list_object.html">QListObject</a> : <span class="keyword">public</span> QObject</div><div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;{</div><div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;    Q_OBJECT</div><div class="line"><a name="l00023"></a><span class="lineno">   23</span>&#160;<span class="keyword">private</span>:</div><div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;    <span class="keywordtype">bool</span> autoDelete = <span class="keyword">false</span>;</div><div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;<span class="keyword">public</span>:</div><div class="line"><a name="l00030"></a><span class="lineno"><a class="line" href="class_q_list_object.html#a035ee9dc9f035443995b9419d32b07da">   30</a></span>&#160;    <span class="keyword">explicit</span> <a class="code" href="class_q_list_object.html#a035ee9dc9f035443995b9419d32b07da">QListObject</a>(QObject *parent = 0) : QObject(parent) {}</div><div class="line"><a name="l00034"></a><span class="lineno"><a class="line" href="class_q_list_object.html#acc9db03436b596a2f274b01a81e8931c">   34</a></span>&#160;    <span class="keyword">explicit</span> <a class="code" href="class_q_list_object.html#acc9db03436b596a2f274b01a81e8931c">QListObject</a>(QObject *parent, <span class="keyword">const</span> std::initializer_list&lt;QObject *&gt; &amp;objects) : QObject(parent) { add(objects); }</div><div class="line"><a name="l00038"></a><span class="lineno"><a class="line" href="class_q_list_object.html#af05889c002163fc36f5eaf12b88363fd">   38</a></span>&#160;    <span class="keyword">explicit</span> <a class="code" href="class_q_list_object.html#af05889c002163fc36f5eaf12b88363fd">QListObject</a>(<span class="keyword">const</span> std::initializer_list&lt;QObject *&gt; &amp;objects) : QObject(nullptr) { add(objects); }</div><div class="line"><a name="l00042"></a><span class="lineno">   42</span>&#160;    ~<a class="code" href="class_q_list_object.html">QListObject</a>();</div><div class="line"><a name="l00048"></a><span class="lineno"><a class="line" href="class_q_list_object.html#a9b87308d291c9699a36849e5d8bfedd4">   48</a></span>&#160;    <span class="keyword">inline</span> QObject *operator [](<span class="keywordtype">int</span> index)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> children()[index]; }</div><div class="line"><a name="l00053"></a><span class="lineno"><a class="line" href="class_q_list_object.html#a4ded55097ea08fa5781240883a591216">   53</a></span>&#160;    <span class="keyword">inline</span> <span class="keywordtype">int</span> <a class="code" href="class_q_list_object.html#a4ded55097ea08fa5781240883a591216">size</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> children().count(); }</div><div class="line"><a name="l00058"></a><span class="lineno"><a class="line" href="class_q_list_object.html#ad5e960eabd3e9b7d49228ea7549a9bd7">   58</a></span>&#160;    <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="class_q_list_object.html#ad5e960eabd3e9b7d49228ea7549a9bd7">add</a>(QObject *<span class="keywordtype">object</span>) { <span class="keywordtype">object</span>-&gt;setParent(<span class="keyword">this</span>); }</div><div class="line"><a name="l00062"></a><span class="lineno"><a class="line" href="class_q_list_object.html#a8114f712189da4ae507ffb4a12eec2f3">   62</a></span>&#160;    <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="class_q_list_object.html#a8114f712189da4ae507ffb4a12eec2f3">add</a>(<span class="keyword">const</span> std::initializer_list&lt;QObject *&gt; &amp;objects)</div><div class="line"><a name="l00063"></a><span class="lineno">   63</span>&#160;    {</div><div class="line"><a name="l00064"></a><span class="lineno">   64</span>&#160;        std::for_each(objects.begin(), objects.end(), [&amp;](QObject *o){ o-&gt;setParent(<span class="keyword">this</span>); });</div><div class="line"><a name="l00065"></a><span class="lineno">   65</span>&#160;    }</div><div class="line"><a name="l00070"></a><span class="lineno"><a class="line" href="class_q_list_object.html#af6bc1883142f976bfd3e82c9d0c030bb">   70</a></span>&#160;    <span class="keyword">inline</span> <span class="keywordtype">void</span> <span class="keyword">remove</span>(QObject *object) { <span class="keywordtype">object</span>-&gt;setParent(<span class="keyword">nullptr</span>); }</div><div class="line"><a name="l00075"></a><span class="lineno"><a class="line" href="class_q_list_object.html#ad9d1f7e3c9f2563bcded31b02edc06fb">   75</a></span>&#160;    <span class="keyword">inline</span> <span class="keywordtype">bool</span> <a class="code" href="class_q_list_object.html#ad9d1f7e3c9f2563bcded31b02edc06fb">getAutoDelete</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> autoDelete; }</div><div class="line"><a name="l00080"></a><span class="lineno"><a class="line" href="class_q_list_object.html#a6c30632fb46f8f7d404f77a9fea49bee">   80</a></span>&#160;    <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="class_q_list_object.html#a6c30632fb46f8f7d404f77a9fea49bee">setAutoDelete</a>(<span class="keywordtype">bool</span> value) { autoDelete = value; }</div><div class="line"><a name="l00081"></a><span class="lineno">   81</span>&#160;};</div><div class="line"><a name="l00082"></a><span class="lineno">   82</span>&#160;</div><div class="line"><a name="l00083"></a><span class="lineno">   83</span>&#160;CWF_END_NAMESPACE</div><div class="line"><a name="l00084"></a><span class="lineno">   84</span>&#160;</div><div class="line"><a name="l00085"></a><span class="lineno">   85</span>&#160;<span class="preprocessor">#endif // QLISTOBJECT_H</span></div><div class="ttc" id="class_q_list_object_html_af05889c002163fc36f5eaf12b88363fd"><div class="ttname"><a href="class_q_list_object.html#af05889c002163fc36f5eaf12b88363fd">QListObject::QListObject</a></div><div class="ttdeci">QListObject(const std::initializer_list&lt; QObject *&gt; &amp;objects)</div><div class="ttdoc">Contructs a QListObject with N elements. </div><div class="ttdef"><b>Definition:</b> qlistobject.h:38</div></div>
<div class="ttc" id="class_q_list_object_html_a8114f712189da4ae507ffb4a12eec2f3"><div class="ttname"><a href="class_q_list_object.html#a8114f712189da4ae507ffb4a12eec2f3">QListObject::add</a></div><div class="ttdeci">void add(const std::initializer_list&lt; QObject *&gt; &amp;objects)</div><div class="ttdoc">This method add a N new QObjects to the list. </div><div class="ttdef"><b>Definition:</b> qlistobject.h:62</div></div>
<div class="ttc" id="class_q_list_object_html_a035ee9dc9f035443995b9419d32b07da"><div class="ttname"><a href="class_q_list_object.html#a035ee9dc9f035443995b9419d32b07da">QListObject::QListObject</a></div><div class="ttdeci">QListObject(QObject *parent=0)</div><div class="ttdoc">This constructor can receive a parent. </div><div class="ttdef"><b>Definition:</b> qlistobject.h:30</div></div>
<div class="ttc" id="class_q_list_object_html_ad9d1f7e3c9f2563bcded31b02edc06fb"><div class="ttname"><a href="class_q_list_object.html#ad9d1f7e3c9f2563bcded31b02edc06fb">QListObject::getAutoDelete</a></div><div class="ttdeci">bool getAutoDelete() const</div><div class="ttdoc">getAutoDelete </div><div class="ttdef"><b>Definition:</b> qlistobject.h:75</div></div>
<div class="ttc" id="class_q_list_object_html_a4ded55097ea08fa5781240883a591216"><div class="ttname"><a href="class_q_list_object.html#a4ded55097ea08fa5781240883a591216">QListObject::size</a></div><div class="ttdeci">int size() const</div><div class="ttdoc">This method returns the number of elements in this QListObject. </div><div class="ttdef"><b>Definition:</b> qlistobject.h:53</div></div>
<div class="ttc" id="class_q_list_object_html_ad5e960eabd3e9b7d49228ea7549a9bd7"><div class="ttname"><a href="class_q_list_object.html#ad5e960eabd3e9b7d49228ea7549a9bd7">QListObject::add</a></div><div class="ttdeci">void add(QObject *object)</div><div class="ttdoc">This method add a new QObject to the list. </div><div class="ttdef"><b>Definition:</b> qlistobject.h:58</div></div>
<div class="ttc" id="class_q_list_object_html_acc9db03436b596a2f274b01a81e8931c"><div class="ttname"><a href="class_q_list_object.html#acc9db03436b596a2f274b01a81e8931c">QListObject::QListObject</a></div><div class="ttdeci">QListObject(QObject *parent, const std::initializer_list&lt; QObject *&gt; &amp;objects)</div><div class="ttdoc">Contructs a QListObject with N elements. </div><div class="ttdef"><b>Definition:</b> qlistobject.h:34</div></div>
<div class="ttc" id="class_q_list_object_html"><div class="ttname"><a href="class_q_list_object.html">QListObject</a></div><div class="ttdoc">The QListObject class is used to pass a list of object to a view page. NOTE: Always when you need to ...</div><div class="ttdef"><b>Definition:</b> qlistobject.h:20</div></div>
<div class="ttc" id="class_q_list_object_html_a6c30632fb46f8f7d404f77a9fea49bee"><div class="ttname"><a href="class_q_list_object.html#a6c30632fb46f8f7d404f77a9fea49bee">QListObject::setAutoDelete</a></div><div class="ttdeci">void setAutoDelete(bool value)</div><div class="ttdoc">setAutoDelete </div><div class="ttdef"><b>Definition:</b> qlistobject.h:80</div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Mon May 28 2018 11:09:08 for C++ Web Framework by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.13
</small></address>
</body>
</html>
